<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"  %>
<html><head>
<!--
Zeke Elder - zbe@andrew.cmu.edu
Amal Chemmany - achemman@andrew.cmu.edu
Nishant Kumar - nkumar1@andrew.cmu.edu
15-637
4/2/2012
-->
<script src="js/fithub.js"></script>
<title>Welcome to FitHub!</title>
<c:if test="${user == null}">
<c:redirect url="welcome.jsp"/>
</c:if>
<link href="css/friends.css" type="text/css" rel="stylesheet">
</head>

<body>


<!-- include header.jsp --> <jsp:include page="./header.jsp" flush="false" />
<div id="maindiv" class="body_container">
<div id="friends_bar">
<form action="search.html">
<table>
<tbody>
<tr>
<th colspan="4" id="friends_title"> Friends
</th>
</tr>
<c:forEach var="entry" items="${friendList}">
	<tr id="${entry.friendName}" class="userentryshow" >
	<th colspan="2" class="friend_img"> <img src="./image.do?userId=${entry.friendId}" alt="pinocchio thum">
	</th>
	<td class="friend_name">${entry.friendName}</td>
	<td class="friend_delete"> <a href="./deleteFriend.do?id=${entry.friendId}">unfriend</a></td>
	</tr>
</c:forEach>
<tr>
<td colspan="3"><input onkeyup ="manageList(this)"  id="search_friend" name="search_friend" value="Search friend" onfocus="if (value == 'Search friend') {value=''}" type="text">
</td>
<td></td>
</tr>
</tbody>
</table>
</form>
</div>
<div id="people_bar">
<h1> Connect to more people</h1>

<div class="centered_div"> 
<form action="searchFriend.do">
<h2> </h2><input id="search_person" name="search_person" type="text"><input value="search" id="search_person_submit" type="submit"></h2> 
</form>
</div>
<div class="centered_div" style="height:100%; overflow: auto"> 
<table>
<tbody>
<c:forEach var="entry" items="${userList}">
	<tr>
	<th colspan="2" class="friend_img"> <img src="./image.do?userId=${entry.userId}" alt="jack thum"> </th>
	<td class="friend_name"> ${entry.firstName}</td> 
	<td class="friend_add"> <a href="./addFriend.do?id=${entry.userId}">friend</a></td>
	</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>
</body></html>